import requests


class InterfaceTest02():
    @classmethod
    def get_bing_zhangzuolin(self):
        url = 'https://cn.bing.com/search?q=%E5%BC%A0%E4%BD%9C%E9%9C%96&qs=n&form=QBRE&sp=-1&lq=0&pq=%E5%BC%A0%E4%BD%9C%E9%9C%96&sc=10-3&sk=&cvid=F634ECE163BE430B86A16EF9C7101AB1&ghsh=0&ghacc=0&ghpl='
        req = requests.get(url)
        print(req.status_code)
        print(req.headers)
        print(req.url)
        print(req.request.method)

    @classmethod
    def get_bing(self):
        url = 'https://cn.bing.com/search'
        # 传参
        params = {'q': '张作霖'}
        req = requests.get(url, params=params)
        print(req.status_code)
        print(req.url)

    @classmethod
    def get_xiaobudian_1(self):
        url = 'https://www.xiaoso.net/m/search?wd=%E8%AF%BB%E8%80%85'
        req = requests.get(url)
        print(req.status_code)
        print(req.headers)
        print(req.url)
        print(req.request.method)

    @classmethod
    def get_xiaobudian_2(self):
        url = 'https://www.xiaoso.net/m/search'
        params = {'wd': '读者'}
        req = requests.get(url, params)
        print(req.status_code)
        print(req.url)


if __name__ == '__main__':
    InterfaceTest02.get_bing_zhangzuolin()
    InterfaceTest02.get_bing()
    InterfaceTest02.get_xiaobudian_1()
    InterfaceTest02.get_xiaobudian_2()
